<?php
/**
 * 缓存配置文件
 * Created by PhpStorm.
 * User: 65736
 * Date: 2018/12/5 0005
 * Time: 23:17
 */
$memcache = [
    'memcache_default' => [
        'type'     => '\app\common\driver\cache\Memcached',
        'host'     => '127.0.0.1',
        'port'     => 11211,
        'expire'   => 0,
        'timeout'  => 0, // 超时时间（单位：毫秒）
        'prefix'   => SYS_NAME.'_'.ENV.'_default_',
        'username' => '', //账号
        'password' => '', //密码
        'option'   => [],
    ],
];

$redis = [
    // 默认redis
    'redis_default' => [
        'type'     => '\app\common\driver\cache\Redis',
        'host'       => '127.0.0.1',
        'port'       => 6379,
        'password'   => '',
        'select'     => 0,
        'timeout'    => 0,
        'expire'     => 0,
        'persistent' => false,
        'prefix'     => SYS_NAME.'_'.ENV.'_default:',
    ],

    // 查重hash指纹redis配置
    'redis_sim_hash' => [
        'type'     => '\app\common\driver\cache\Redis',
        'host'       => '127.0.0.1',
        'port'       => 6379,
        'password'   => '',
        'select'     => 0,
        'timeout'    => 0,
        'expire'     => 0,
        'persistent' => false,
        'prefix'     => SYS_NAME.'_'.ENV.'_default:',
    ],

    // 采集下载队列
    'redis_spiderDownQueue' => [
        'type'     => '\app\common\driver\cache\Redis',
        'host'       => '127.0.0.1',
        'port'       => 6379,
        'password'   => '',
        'select'     => 0,
        'timeout'    => 0,
        'expire'     => 0,
        'persistent' => false,
        'prefix'     => SYS_NAME.'_'.ENV.'_default:',
    ],
];

$default = [
    // 默认缓存
    'default' => [
        // 驱动方式
        'type'   => 'File',
        // 缓存保存目录
        'path'   => CACHE_PATH,
        // 缓存前缀
        'prefix' => '',
        // 缓存有效期 0表示永久缓存
        'expire' => 0,
    ],
];

$complex_cache = array_merge(
    array('type'  =>  'complex'),
    $memcache,
    $redis,
    $default
);

return [
    'cache'                  => $complex_cache,
];